//
//  JSExcuteObject.h
//  EClub
//
//  Created by iBenz on 16/6/28.
//  Copyright © 2016年 EC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <JavaScriptCore/JavaScriptCore.h>

// Below for WKWebView
#import <WebKit/WebKit.h>
extern NSString *const requestInterOp;
extern NSString *const requestInfo;  // 请求用户信息
extern NSString *const requestSign;  // 请求签名
extern NSString *const taskComplete; // 任务完成
#define ScriptNames @[requestInterOp,requestInfo,requestSign,taskComplete]

@protocol EDGJSProtocol <NSObject,JSExport>

// JS请求用户资料
- (void)setInfo;

// JS请求签名
- (void)setSign:(NSString *)value;

// JS通知任务完成
- (void)TaskComplete:(NSString *)task;

@end

@interface JSExcuteObject : NSObject<EDGJSProtocol, WKScriptMessageHandler>
@property(nonatomic, weak) WKWebView *webView; // iOS8.0 and later
+ (instancetype)JSExcuteObjectWithContext:(JSContext *)context; // Before iOS8.0
@end
